package com.xyazm.user.controller;

import com.xyazm.user.domain.vo.UserInfoVO;
import com.xyazm.user.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 后台用户管理Controller
 */
@Api(tags = "UmsAdminController", description = "后台用户管理")
@RestController
@RequestMapping("/admin/user")
public class UserController {

    @Autowired
    private IUserService userService;


    @ApiOperation(value = "获取当前登录用户信息")
    @GetMapping(value = "/info")
    public UserInfoVO getUserInfo(String username) {
        if (StringUtils.isEmpty(username)) {
            username = "admin";
        }
        return userService.getUserInfo(username);
    }

}
